In [1]:
import numpy as np
import sympy as sp
from IPython.display import display, Latex, Markdown
import plotly
import plotly.graph_objects as go
import sys, os
sys.path.append('../Chapitre 8 - Valeurs propres, vecteurs propres, diagonalisation')
from Ch8_lib import *
sys.path.append('../Librairie')
import AL_Fct as al
from Ch10_lib import *

DÉFINITION:¶

Une forme quadratique $Q$ sur $\mathbb{R}^{n}$ est une application $Q: \mathbb{R}^{n} \rightarrow \mathbb{R}$ définie par une matrice symétrique $A \in M_{n \times n}(\mathbb{R})$ de telle sorte que $Q(u)=u A u^{T}$ pour tout $u \in \mathbb{R}^{n}$. Aussi, si $x_{1}, \ldots, x_{n}$ sont des variables, alors l'équation $Q\left(x_{1}, \ldots, x_{n}\right)=1$ définit une conique dans $\mathbb{R}^{2}$ (respectivement, une quadrique dans $\mathbb{R}^{3}$ ).

Exercice 1 :¶

Determinez si les expressions suivantes correspondent à des formes quadratiques.

In [2]:
ch10_7_ex_1_1()
Le polynôme $Q = x_{1}^{2} - 5 x_{1} x_{2} + x_{1} x_{3} - x_{1} x_{4} + 4 x_{2}^{2} + 2 x_{2} x_{3} - 4 x_{2} x_{4} + x_{3}^{2} + x_{3} x_{4} - x_{4}^{2}$ est-il une forme quadratique ?
Correct !
Le polynôme $Q = x_{1}^{2} - 5 x_{1} x_{2} + x_{1} x_{3} - x_{1} x_{4} + 4 x_{2}^{2} + 2 x_{2} x_{3} - 4 x_{2} x_{4} + x_{3}^{2} + x_{3} x_{4} - x_{4}^{2}$ est une forme quadratique car il contient uniquement des termes d'ordre 2.
Incorrect.
In [3]:
ch10_7_ex_1_2()
Le polynôme $Q = \left(x_{1} + x_{2}\right)^{2} + \left(x_{3} - 1\right)^{2}$ est-il une forme quadratique ?
Correct !
Le polynôme $Q = \left(x_{1} + x_{2}\right)^{2} + \left(x_{3} - 1\right)^{2}$ n'est pas une forme quadratique car il ne contient pas uniquement des termes d'ordre 2.
On peut developper $Q$ pour expliciter l'ordre de chaque terme.
$$ Q = x_{1}^{2} + 2 x_{1} x_{2} + x_{2}^{2} + x_{3}^{2} - 2 x_{3} + 1$$
Incorrect.
In [4]:
ch10_7_ex_1_3()
Le polynôme $Q = 3 x_{1}^{2} + x_{1} x_{2} - x_{1} x_{3} + x_{2}^{2} + 2 x_{2} x_{3} + x_{3}^{3}$ est-il une forme quadratique ?
Correct !
Le polynôme $Q = 3 x_{1}^{2} + x_{1} x_{2} - x_{1} x_{3} + x_{2}^{2} + 2 x_{2} x_{3} + x_{3}^{3}$ n'est pas une forme quadratique car il ne contient pas uniquement des termes d'ordre 2.
Incorrect.

Exercice 2 :¶

Trouvez la matrice symétrique $A$ telle que $\mathbf{x}^T A \mathbf{x} = Q(\mathbf{x})$ avec $\mathbf{x} = \left(\begin{array}{l}x_{1} \\ x_{2} \\ .. \\ .. \\ x_{n}\end{array}\right) $

In [5]:
ch10_7_ex_2(1)
Rentrez la matrice symétrique $A$ telle que $\mathbf{x}^T A \mathbf{x}=Q(\mathbf{x})$, où $Q(\mathbf{x})=- 2 x_{1}^{2} + 6 x_{1} x_{2} + 4 x_{2}^{2}$

A =

Correct !
Incorrect.
La matrice $A = \left(\begin{matrix}-2 & 3\\3 & 4\end{matrix}\right)$ est telle que $Q(\mathbf{x}) = \mathbf{x}^T A \mathbf{x} $
In [6]:
ch10_7_ex_2(2)
Rentrez la matrice symétrique $A$ telle que $\mathbf{x}^T A \mathbf{x}=Q(\mathbf{x})$, où $Q(\mathbf{x})=x_{1}^{2} + 6 x_{1} x_{3} - 2 x_{2}^{2} - \frac{x_{2} x_{3}}{2} + 4 x_{3}^{2}$

A =

Correct !
Incorrect.
La matrice $A = \left(\begin{matrix}1 & 0 & 3\\0 & -2 & - \frac{1}{4}\\3 & - \frac{1}{4} & 4\end{matrix}\right)$ est telle que $Q(\mathbf{x}) = \mathbf{x}^T A \mathbf{x} $
In [7]:
ch10_7_ex_2(3)
Rentrez la matrice symétrique $A$ telle que $\mathbf{x}^T A \mathbf{x}=Q(\mathbf{x})$, où $Q(\mathbf{x})=- x_{1}^{2} - 2 x_{1} x_{2} + 6 x_{1} x_{3} - 2 x_{2}^{2} + 8 x_{2} x_{4} - 2 x_{3} x_{4} + 2 x_{4}^{2}$

A =

Correct !
Incorrect.
La matrice $A = \left(\begin{matrix}-1 & -1 & 3 & 0\\-1 & -2 & 0 & 4\\3 & 0 & 0 & -1\\0 & 4 & -1 & 2\end{matrix}\right)$ est telle que $Q(\mathbf{x}) = \mathbf{x}^T A \mathbf{x} $

Passez au notebook du chapitre 10.8 Théroème des axes principaux